<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      
    </div>

    <script src="../js/vue.js"></script>

    <script>
      const app = Vue.createApp({
        data() {
          return {
            msg: ""
          }
        },
        template:`
          <div>
            <lk-box info="hahahha" style="background-color:red; width:200px; height:200px"></lk-box>
          </div>
        `
      });

      app.component('lk-box',{
        //props:['info'],
        //不接受no-props属性
        //inheritAttrs:false,
        mounted(){
          console.log(this.$attrs);
        },
        // template:`
        // <div >我是子组件--{{$attrs.info}}</div>
        // `
        //如果有多个同级别标签, no-props是不生效的
        template:`
          <div :s1="$attrs.info">我是子组件</div>
          <div :="$attrs">我是子组件</div>
          <div :style="$attrs.style">我是子组件</div>
        `
      });

      app.mount('#app');
    </script>
  </body>
</html>